from django.db import models

from myuser.models import MyUser
from prj004.models.models import CreateTimeModel
from prj004.models.info import Info


class Relevant(CreateTimeModel):
    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj004_relevant')

    info = models.OneToOneField(Info, related_name='relevant', on_delete=models.CASCADE)

    tige_check_wu = models.BooleanField(default=False, blank=True, verbose_name='无', help_text='无')

    tige_check_fu = models.BooleanField(default=False, blank=True, verbose_name='妇科检查', help_text='妇科检查')

    tige_check_quan = models.BooleanField(default=False, blank=True, verbose_name='全身检查', help_text='全身检查')

    fuzhu_wu = models.BooleanField(default=False, blank=True, verbose_name='无', help_text='无')

    fuzhu_chaosheng = models.BooleanField(default=False, blank=True, verbose_name='超声检查', help_text='超声检查')

    fuzhu_baidai = models.BooleanField(default=False, blank=True, verbose_name='白带常规', help_text='白带常规')

    fuzhu_tiwen = models.BooleanField(default=False, blank=True, verbose_name='基础体温测定（BBT)', help_text='基础体温测定（BBT)')

    fuzhu_hcg = models.BooleanField(default=False, blank=True, verbose_name='尿妊娠试验或血hCG检测', help_text='尿妊娠试验或血hCG检测')

    fuzhu_jisu = models.BooleanField(default=False, blank=True, verbose_name='性激素六项（FSH、LH、E2、PRL、T、P）', help_text='性激素六项（FSH、LH、E2、PRL、T、P）')

    fuzhu_amh = models.BooleanField(default=False, blank=True, verbose_name='AMH', help_text='AMH')

    fuzhu_guagong = models.BooleanField(default=False, blank=True, verbose_name='刮宫或子宫内膜活组织检查', help_text='刮宫或子宫内膜活组织检查')

    fuzhu_gongqiang = models.BooleanField(default=False, blank=True, verbose_name='宫腔镜检查', help_text='宫腔镜检查')

    fuzhu_jiazhuang = models.BooleanField(default=False, blank=True, verbose_name='甲状腺功能测定（TSH、FT3、FT4、T3、T4）', help_text='甲状腺功能测定（TSH、FT3、FT4、T3、T4）')

    fuzhu_danbai = models.BooleanField(default=False, blank=True, verbose_name='抗甲状腺球蛋白抗体（anti-Tg）', help_text='抗甲状腺球蛋白抗体（anti-Tg）')

    fuzhu_yanghua = models.BooleanField(default=False, blank=True, verbose_name='抗甲状腺炎过氧化物酶抗体（anti-TPO）', help_text='抗甲状腺炎过氧化物酶抗体（anti-TPO）')

    fuzhu_kanghe = models.BooleanField(default=False, blank=True, verbose_name='抗核抗体', help_text='抗核抗体')

    fuzhu_kanglin = models.BooleanField(default=False, blank=True, verbose_name='抗磷脂抗体', help_text='抗磷脂抗体')

    fuzhu_dna = models.BooleanField(default=False, blank=True, verbose_name='抗双链DNA抗体', help_text='抗双链DNA抗体')

    fuzhu_fengbi = models.BooleanField(default=False, blank=True, verbose_name='封闭抗体', help_text='封闭抗体')

    fuzhu_xibao = models.BooleanField(default=False, blank=True, verbose_name='全血细胞计数', help_text='全血细胞计数')

    fuzhu_ningxue = models.BooleanField(default=False, blank=True, verbose_name='凝血功能检查', help_text='凝血功能检查')

    fuzhu_erju = models.BooleanField(default=False, blank=True, verbose_name='D-二聚体', help_text='D-二聚体')

    fuzhu_xuejiang = models.BooleanField(default=False, blank=True, verbose_name='血浆同型半胱氨酸', help_text='血浆同型半胱氨酸')

    fuzhu_huohua = models.BooleanField(default=False, blank=True, verbose_name='活化蛋白C抵抗试验', help_text='活化蛋白C抵抗试验')

    fuzhu_fuqi = models.BooleanField(default=False, blank=True, verbose_name='夫妻双方染色体检查', help_text='夫妻双方染色体检查')

    IS_FUZHU_FUQI_CHOICES = (
        ('不详', '不详'),
        ('正常', '正常'),
        ('异常', '异常')
    )
    is_fuzhu_fuqi = models.CharField(choices=IS_FUZHU_FUQI_CHOICES, max_length=4, null=True, blank=True, verbose_name='夫妻双方染色体检查', help_text='夫妻双方染色体检查')

    fuzhu_fuqi_yichang = models.CharField(max_length=50, null=True, blank=True, verbose_name='夫妻双方染色体检查-异常', help_text='夫妻双方染色体检查-异常')

    fuzhu_nanfang = models.BooleanField(default=False, blank=True, verbose_name='男方精液检查', help_text='男方精液检查')

    is_fuzhu_nanfang = models.CharField(choices=IS_FUZHU_FUQI_CHOICES, max_length=4, null=True, blank=True, verbose_name='男方精液检查', help_text='男方精液检查')

    fuzhu_nanfang_yichang = models.CharField(max_length=50, null=True, blank=True, verbose_name='男方精液检查-异常', help_text='男方精液检查-异常')

    fuzhu_qita = models.CharField(max_length=50, null=True, blank=True, verbose_name='其他', help_text='其他')

    def __str__(self):
        return '{}-{}'.format(self.owner, self.info)

    class Meta:
        verbose_name = '相关检查'
        verbose_name_plural = verbose_name
